<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<script>
		{
			let a=10;
			var b=2;
		}
		// console.log(a);   //Uncaught ReferenceError: a is not defined
		console.log(b);    //2

		//for循环的计数器，很适合用let命令
		for(var i=0;i<10;i++){
			//
		}
		console.log(i);    //10

	</script>
</body>
</html>